﻿@model List<DLULearningNetworkModel.Friend>
@{
    DLULearningNetworkModel.Account accountOwner = ViewBag.AccountOwner;
    DLULearningNetworkModel.Account accountOfFriend = null;
}
<p style="margin-bottom: 15px; padding: 5px 3px; border-left: 18px solid green; border: 1px solid green;
    text-align: center;">
    <a href="/UserPage/FriendList/@ViewBag.ownerNickname" style="color: Green; font-weight: bold;">
        Bạn bè</a></p>
<div class="vscrollbar">
    <div class="scrollbar">
        <div class="track">
            <div class="thumb">
                <div class="end">
                </div>
            </div>
        </div>
    </div>
    <div class="viewport">
        <div class="overview">
            @if (Model != null)
            {
                if (Model.Count != 0)
                {
                <ul style="padding-bottom: 5px;padding-left:5px;">
                    @foreach (DLULearningNetworkModel.Friend fr in Model)
                    {
                        if (fr.AccountID_u == accountOwner.AccountID_u)
                        {
                            accountOfFriend = fr.Account1Reference.Value;
                        }
                        else
                        {
                            accountOfFriend = fr.AccountReference.Value;
                        }
                        <li style="clear: both; padding-top: 5px;">
                            <div style="float: left; width: 45px;">
                                <a href="/UserPage/UserHome/@accountOfFriend.Nickname_s">
                                    <img src="@DLULearningNetwork.Libs.StringHelper.GetImageUrl(accountOfFriend.Avatar_s, 2)" style="width: 40px; height: 40px; float: left;
                            padding-right: 3px;" /></a>
                            </div>
                            <div style="float: left; width: 140px;">
                                <a href="/UserPage/UserHome/@accountOfFriend.Nickname_s"><span style="display: table-row;">@accountOfFriend.LastName_s
                                    @accountOfFriend.FirstName_s</span></a>
                            </div>
                        </li>
                    }
                </ul>
        
                }
                else
                { 
                <p name="noRequest" style="padding-left: 10px;">
                    Chưa có bạn nào</p>
                }
            }
            else
            {
                <p name="noRequest" style="padding-left: 10px;">
                    Không chia sẻ bạn bè</p>
            }
        </div>
    </div>
</div>
